package com.hu.video.mapper;

import com.hu.video.entity.VideoVisibility;
import org.apache.ibatis.annotations.*;

@Mapper
public interface VideoVisibilityMapper {
    @Select("SELECT * FROM video_visibility WHERE video_id = #{videoId}")
    VideoVisibility selectByVideoId(Long videoId);

    @Insert("INSERT INTO video_visibility (video_id, visibility_type, create_time, update_time) VALUES (#{videoId}, #{visibilityType}, NOW(), NOW())")
    int insert(VideoVisibility visibility);

    @Update("UPDATE video_visibility SET visibility_type = #{visibilityType}, update_time = NOW() WHERE video_id = #{videoId}")
    int update(VideoVisibility visibility);
} 